/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.helpdesk.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JK
 */
@Entity
@Table(name = "ComplaintAssignToAccounts")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ComplaintAssignToAccounts.findAll", query = "SELECT c FROM ComplaintAssignToAccounts c"),
    @NamedQuery(name = "ComplaintAssignToAccounts.findById", query = "SELECT c FROM ComplaintAssignToAccounts c WHERE c.id = :id"),
    @NamedQuery(name = "ComplaintAssignToAccounts.findByDateAssigned", query = "SELECT c FROM ComplaintAssignToAccounts c WHERE c.dateAssigned = :dateAssigned")})
public class ComplaintAssignToAccounts implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Column(name = "DateAssigned")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateAssigned;
    @JoinColumn(name = "ComplaintID", referencedColumnName = "ID")
    @ManyToOne
    private Complaints complaintID;
    @JoinColumn(name = "AccountID", referencedColumnName = "ID")
    @ManyToOne
    private Accounts accountID;

    public ComplaintAssignToAccounts() {
    }

    public ComplaintAssignToAccounts(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDateAssigned() {
        return dateAssigned;
    }

    public void setDateAssigned(Date dateAssigned) {
        this.dateAssigned = dateAssigned;
    }

    public Complaints getComplaintID() {
        return complaintID;
    }

    public void setComplaintID(Complaints complaintID) {
        this.complaintID = complaintID;
    }

    public Accounts getAccountID() {
        return accountID;
    }

    public void setAccountID(Accounts accountID) {
        this.accountID = accountID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ComplaintAssignToAccounts)) {
            return false;
        }
        ComplaintAssignToAccounts other = (ComplaintAssignToAccounts) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.helpdesk.entities.ComplaintAssignToAccounts[ id=" + id + " ]";
    }
    
}
